package com.hellogood.work.evaluate.server.serviceImpl;

import java.util.List;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;
import com.hellogood.work.evaluate.server.dao.ServiceDAO;
import com.hellogood.work.evaluate.shared.po.Service;
import com.hellogood.work.evaluate.shared.services.ServiceService;

public class ServiceServiceImpl extends RemoteServiceServlet implements ServiceService {

	private static final long serialVersionUID = -5317920507845420765L;

	@Override
	public List<Service> getList() {
		ServiceDAO dao = new ServiceDAO();
		return dao.getList();
	}

	@Override
	public int getTotalNumber() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String modify(Service s, boolean isModiy) {
		ServiceDAO dao = new ServiceDAO();
		if (!isModiy) {
			if (dao.getItem(s.getServiceCode()) != null) {
				return "服务编号：" + s.getServiceCode() + "已经存在";
			}
		}
		return dao.modify(s, isModiy);
	
	}
}
